-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Try to parse the year when 'year' tag could be a date #104
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the change! Slight simplification to make it more clear that we're not changing behaviour when year = 0
(nonsense though that would be!).
Co-authored-by: David Howden <dhowden@gmail.com>
So I completely missed that the build was failing on here! |
...and I can't fix this it would seem. Can you bump the go.mod to 1.20 as that's the requirement for this? |
Done. |
I forgot the workflow file, now it should pass. |
When the year/date tag is a date, it can't be parsed into a number, so the
Year()
method returns a zero value. This PR tries to fix this by checking if theAtoi()
function returns 0. If it does, the string is parsed as a date, and the year is returned. If parsing fails, it still returns zero.